﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using AdvanceLib.Core;
using AdvanceLib.ClassExtensions;

namespace AdvanceLib.ScriptCore.SystemCommands
{
    public class Dynamic : SystemCommand
    {
        #region SystemCommand Member
        public override string Name
        {
            get { return "dynamic"; }
        }
        public override int ExpectedParameters
        {
            get { return 1; }
        }
        public override void Execute(ScriptHost host, string[] parameters)
        {
            long offset = 0;
            parameters[Constants.FIRST_INDEX].TryParse(ref offset);

            Settings.Instance["DynamicOffset"] = offset;
        }
        public override bool DebugParameter(int paramIndex, string paramValue)
        {
            switch (paramIndex)
            {
                case 0: return paramValue.IsHex() || paramValue.IsDecimal();
            }
            return false;
        }
        #endregion
    }
}
